<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8" isELIgnored="false" %>
<!DOCTYPE html>
<html lang="zh_cn" ng-app="com.chag.app">
<head>
    <meta charset="UTF-8">
    <title>用户 - 登录界面</title>
    <link href="//cdn.bootcss.com/semantic-ui/2.1.8/semantic.css" rel="stylesheet">
    <link href="/home/static/css/pc/customized/common.css" rel="stylesheet">
    <script src="//cdn.bootcss.com/jquery/2.2.3/jquery.js"></script>
    <script src="//cdn.bootcss.com/semantic-ui/2.1.8/semantic.js"></script>
    <script src="//cdn.bootcss.com/angular.js/1.5.6/angular.js"></script>
    <script src="//cdn.bootcss.com/angular.js/1.5.6/i18n/angular-locale_zh.js"></script>
    <script src="//cdn.bootcss.com/angular.js/1.5.6/angular-route.js"></script>
    <script src="//cdn.bootcss.com/angular.js/1.5.6/angular-messages.js"></script>
    <style type="text/css">
        *{
            font-family: 微软雅黑;
        }

        input{
            font-family: 微软雅黑, "微软雅黑 Light";
        }

        .login-content{
            margin-top: 20px;
        }
    </style>
</head>
<body>
<div class="login-content">
    <div class="ui grid page center aligned">
        <div class="row">
            <div class="six wide column">
                <h3 class="ui header">
                    <i class="user icon"></i>用户登录
                </h3>
                <form accept-charset="UTF-8" class="left aligned ui form segment" id="new_user" action="/admin/doLogin" method="post">
                    <div style="margin:0;padding:0;display:inline">
                        <input name="utf8" type="hidden" value="✓">
                        <input name="authenticity_token" type="hidden" value="NladavbzryXSp+ECpKGfurjybESOBj9vh2FC7stYdlI=">
                    </div>
                    <div class="field" id="git-login">
                        <div class="ui left icon input">
                            <input id="user_login" name="account[email]" placeholder="请输入邮箱" size="30" type="text">
                            <i class="user icon"></i>
                        </div>
                    </div>
                    <div class="field">
                        <div class="ui left icon input">
                            <input id="user_password" name="account[password]" placeholder="密码不少于6位" size="30" type="password">
                            <i class="icon key"></i>
                        </div>
                    </div>
                    <div class="two fields">
                        <div class="field">
                            <div class="ui checkbox"><input name="account[remember_me]" type="hidden" value="0">
                                <input id="user_remember_me" name="account[remember_me]" type="checkbox" value="1">
                                <label>记住我</label>
                            </div>
                        </div>
                        <div class="field" style="text-align: right">
                            <a href="/password/new">忘记密码?</a>
                        </div>
                    </div>
                    <div class="field">
                        <input class="ui small fluid blue submit button" name="commit" type="submit" value="登录">
                    </div>
                    <div class="field">
                        <span style="text-align: center;color: #888;">你也可以利用以下方式进行登录</span>
                        <div class="ui horizontal list" style="margin-top:20px;color:#eeeeee">
                            <div class="item" style="line-height:48px">
                                <a href="/auth/oschina"><i class="oauth-icon icon-osc-oschina" style="font-size:33px;color:#3b83c0" title="使用OSChina帐号登录"></i></a>
                            </div>
                            <div class="item" style="line-height:48px">
                                <a href="/auth/github"><i class="icon github" style="font-size:36px;color:#3b83c0" title="使用Github帐号登录"></i></a>
                            </div>
                            <div class="item" style="line-height:48px">
                                <a href="/auth/weibo"><i class="icon weibo" style="font-size:36px;color:#3b83c0" title="使用Weibo帐号登录"></i></a>
                            </div>
                            <div class="item" style="line-height:48px">
                                <a href="/auth/qq_connect"></a></div>
                            <div class="item" style="line-height:48px">
                                <a href="/auth/windowslive"><i class="icon windows" style="font-size:36px;color:#3b83c0" title="使用WindowsLive帐号登录"></i></a>
                            </div>
                        </div>
                        <div class="field">
                            <div class="ui divider"></div>
                            <span class="float-left"><a href="/account/activate">重发激活邮件</a></span>
                            <span class="float-right"><a href="/signup">账号注册</a></span>
                        </div>
                    </div>
                </form>

            </div>
        </div>
        <script>
            $('.ui.checkbox').checkbox({
                onChange: function () {
                    var checked = this[0].checked;
                    var value = checked ? 1 : 0;
                    $(this).val(value).siblings('input').val(value);
                }
            });
            $('#new_user.ui.form').form({
                loginName: {
                    identifier: 'account[email]',
                    rules: [
                        {
                            type: 'empty',
                            prompt: "请输入邮箱"
                        }
                    ]
                },
                password: {
                    identifier: 'account[password]',
                    rules: [
                        {
                            type: 'length[6]',
                            prompt: "请输入密码"
                        }
                    ]
                }
            }, {
                inline: true,
                on: 'blur'
            });
        </script>
    </div>
</div>
</body>
</html>